From: Michael Young Date: Tue, 25 Oct 2011 18:15:54 +0000 (+0100) Subject: pygrub: check all GPT partitions X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=66b1787ae57c27be62f31902e4d5d510610b8dc6;p=xen.git pygrub: check all GPT partitions On Fedora 16 the first GPT partition is a boot partition for grub2 with the grub2 configuration in the second partition. Check all GPT partitions for grub configuration, not just the first. [ Also remove now-inaccurate comment. -iwj ] Signed-off-by: Michael Young Tested-by: Paolo Bonzini Signed-off-by: Ian Jackson Committed-by: Ian Jackson --- diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub index 5dc9405cf6..4dc42f7f3a 100644 --- a/tools/pygrub/src/pygrub +++ b/tools/pygrub/src/pygrub @@ -77,10 +77,17 @@ def get_solaris_slice(file, offset): def get_fs_offset_gpt(file): fd = os.open(file, os.O_RDONLY) - # assume the first partition is an EFI system partition. - os.lseek(fd, SECTOR_SIZE * 2, 0) + os.lseek(fd, SECTOR_SIZE, 0) buf = os.read(fd, 512) - return struct.unpack("0: + buf = os.read(fd, partsize) + offsets.append(struct.unpack("